<ion-view hide-back-button="true" view-title="任务" style="background-color: #E5EEF4">
	<ion-nav-buttons side="left">
		<span ng-if="vm.showContent" class="nav-right-button" style="font-size: 1.6rem" ng-click="hideContent()">
            <i class="icon ion-android-arrow-back"></i>
        </span>
	</ion-nav-buttons>
	<ion-nav-title>
		<div class="button-group" ng-init="init();" ng-if="!isProjectTract">
			<span class="nav-center-button{{isTodo ? '' : '-unselect'}}" ng-click="getProjectListWithStatus('FOR_ORDER',$event)">待接单<div ng-if="countOfTasks.tab1 != 0" class="nav-title-count">{{countOfTasks.tab1 > 99 ? '...' : countOfTasks.tab1}}</div></span>
			<span class="nav-center-button{{isOnline ? '' : '-unselect'}}" ng-click="getProjectListWithStatus('ON_GOING',$event)">跟进中<div ng-if="countOfTasks.tab2 != 0" class="nav-title-count">{{countOfTasks.tab2 > 99 ? '...' : countOfTasks.tab2}}</div></span>
			<span ng-if="btnShow('LIST-DFP')" class="nav-center-button{{isChoice ? '' : '-unselect'}}" ng-click="getProjectListWithStatus('FOR_ASSIGN',$event)">待分配<div ng-if="countOfTasks.tab3 != 0" class="nav-title-count">{{countOfTasks.tab3 > 99 ? '...' : countOfTasks.tab3}}</div></span>
			<span ng-if="btnShow('LIST-DSH')" class="nav-center-button{{isCheck ? '' : '-unselect'}}" ng-click="getProjectListWithStatus('IS_CHECK',$event)">审核中<div ng-if="countOfTasks.tab4 != 0" class="nav-title-count">{{countOfTasks.tab4 > 99 ? '...' : countOfTasks.tab4}}</div></span>
			<!--ng-if=vm.choiceBtn -->
		</div>
    <div ng-if="isProjectTract">
      项目档案
    </div>
	</ion-nav-title>
	<ion-nav-buttons side="right">
		<span class="nav-right-button" ng-click="forwardIntention()" ng-if="!isProjectTract">
      <i class="nav-right-button ion-plus-round"></i>
    </span>
	</ion-nav-buttons>
	<ion-content id="taskView">
		<ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
		<ion-list>
			<div style="background-color: white;width: 100%;height: 40px; position: absolute;z-index: -1;"></div>
			<label class="item item-input list-search">
        <i class="icon ion-search placeholder-icon"></i>
        <input type="text" placeholder="状态/编号/地址/客户/手机" ng-model="vm.search">
      </label>
			<ion-item style="margin-bottom: 20px;" class="item item-padding-left" ng-repeat="item in items
        | filter: projectFilter">
				<ion-item ng-click="goToTaskFollow(item)" class="item-bg">
					<span class="project-spms-title">{{$index+1}}.{{item.projectNumber}}</span>
					<span class="project-spms-status">{{item.statusDesc}}</span>
				</ion-item>
				<ion-item class="item-bg" ng-click="call(item.contactsTel)">
					<img ng-src="img/icon-people.png">
					<span class="project-spms-label">客户联系人</span>
					<span class="project-spms-info" style="min-width: 45%;float: right!important;">{{item.customerName}} {{item.contactsTel}}</span>
					<!--<img cache-src="img/icon-phone.png" width="20px;" style="float: right;margin-right: 20px" ng-click="call(item.contactsTel)">-->
				</ion-item>
				<ion-item class="item-bg">
					<img ng-src="img/icon-building.png">
					<span class="project-spms-label">所属地区</span>
					<span class="project-spms-info">{{item.regionDesc}}</span>
				</ion-item>
				<ion-item class="item-bg">
					<img ng-src="img/icon-building.png">
					<span class="project-spms-label">详细地址</span>
					<span class="project-spms-info">{{item.address}}</span>
				</ion-item>
				<ion-item class="item-bg" ng-click="goInputText(item, 'remark', true)">
					<img ng-src="img/icon-pen.png">
					<span class="project-spms-label">项目备注</span>
					<span class="project-spms-info">{{item.remark}}</span>
				</ion-item>
				<ion-item class="item-bg" ng-click="choiceDate(item)" ng-if="item.status == 'INSTALLING'">
					<img ng-src="img/icon-pen.png">
					<span class="project-spms-label">计划开工时间</span>
					<span class="project-spms-info">{{!item.planDate ? "请填写" : item.planDate.substring(0, item.planDate.indexOf(" "))}}</span>
				</ion-item>
				<ion-item class="item-bg" style="padding: 3px 3%; margin-left: 0px;" ng-hide="">
					<button class="button-tasks" ng-click="forwardAssigned(item)" ng-if="isChoice">项目分配</button>
					<button class="button-tasks" ng-click="forwardProjectLog(item)" ng-if="btnShow('XMRZ',item) && !isTodo">项目日志</button>
					<!--P 项目整改-->
					<button class="button-tasks" ng-click="forwardCorrectionIng(item)" ng-if="btnShow('FAZG',item) && isOnline">项目整改</button>

					<!--N并网完成-->
					<button class="button-tasks" ng-click="forwardCorrection(item)" ng-if="btnShow('YQZG',item) && isCheck">要求整改</button>
					<button class="button-tasks" ng-click="forwardAgreeComplete(item)" ng-if="btnShow('TYWG',item) && isCheck">同意完工</button>

					<!--M安装完成-->
					<button class="button-tasks" ng-click="forwardCheckAndReceive(item)" ng-if="btnShow('BWYS',item) && isOnline">并网验收</button>
					<!--<button class="button-tasks" ng-click="forwardCheckAndReceive(item)">并网验收</button>-->

					<!--L安装中-->
					<button class="button-tasks" ng-click="forwardProgressReport(item)" ng-if="item.getGoods == '收货完成' && isOnline && btnShow('JDBG',item)">进度报告</button>
					<!--<button class="button-tasks" ng-click="forwardProgressReport(item)" btnShow('JDBG',item)>进度报告</button>-->
					<button class="button-tasks" ng-click="forwardCheckProject(item)" ng-if="item.getGoods == '收货完成' && isOnline && btnShow('XMZC',item)">项目自查</button>
					<!--<button class="button-tasks" ng-click="forwardCheckProject(item)" ng-if="btnShow('XMZC',item) && isOnline">项目自查</button>-->
					<button ng-class="item.engineerStatus != 'SUBMIT' ? 'button-tasks' : 'button-tasks-gray'" ng-disabled = "item.engineerStatus == 'SUBMIT'" ng-click = "forwardQutyChange('GLBG', item)" ng-if="btnShow('GLBG',item) && isOnline">工程量变更</button>
          <!--<button class="button-tasks" ng-click="forwardQutyChange('GLBG', item)">工程量变更</button>-->

					<button class="button-tasks" ng-click="forwardDelivery(item)" ng-if="btnShow('SH',item) && isOnline">收货</button>
					<!--<button class="button-tasks" ng-click="forwardDelivery(item)">收货</button>-->

					<button class="button-tasks" ng-click="forwardQutyChangeAuditing('SHBG', item)" ng-if="btnShow('SHBG',item) && isCheck">审核变更</button>
					<!--J合同已签订-->
					<button class="button-tasks" ng-click="startConstruction(item)" ng-if="btnShow('QDSG',item) && isOnline">启动施工</button>
					<button class="button-tasks" ng-click="forwardSendTheGoods(item)" ng-if="btnShow('FH',item) && isOnline">发货</button>
					<!--<button class="button-tasks" ng-click="forwardSendTheGoods(item)">发货</button>-->
					<!--I审核完成-->
					<button class="button-tasks" ng-click="forwardContractSign(item)" ng-if="btnShow('HTQD',item) && isOnline">合同签订</button>
					<!--<button class="button-tasks" ng-click="forwardContractSign(item)">合同签订</button>-->

					<!--H方案审核中-->
					<button class="button-tasks" ng-click="rejectProject(item)" ng-if="btnShow('WGSPJJ',item) && isCheck">审批拒绝</button>
					<button class="button-tasks" ng-click="approveProject(item)" ng-if="btnShow('WGSPTG',item) && isCheck">审批通过</button>
					<!--G勘察完成-->
					<button class="button-tasks" ng-click="forwardSubmitDesign(item)" ng-if="btnShow('TJSH',item) && isOnline">提交审核</button>
					<button class="button-tasks" ng-click="forwardDesign(item)" ng-if="btnShow('FASJ',item) && isOnline">方案设计</button>
					<!--F勘察中-->
					<button class="button-tasks" ng-click="forwardFinishSurvey(item)" ng-if="btnShow('WCKC',item) && isOnline">完成勘察</button>
					<button class="button-tasks" ng-click="forwardSurvey(item)" ng-if="btnShow('JRKC',item) && isOnline">进入勘察</button>
					<button class="button-tasks" ng-click="forwardLookFollow(item)" ng-if="btnShow('CKXSGJ',item) && isOnline">查看跟进</button>
					<!--B跟进中-->
					<button class="button-tasks" ng-click="forwardCancel(item)" ng-if="btnShow('QXYX',item) && isOnline">取消意向</button>
					<button class="button-tasks" ng-click="forwardSendSurvey(item)" ng-if="btnShow('FQKC',item) && isOnline">发起勘察</button>
					<button class="button-tasks" ng-click="forwardFollow(item)" ng-if="btnShow('XSGJ',item) && isOnline">初勘</button>
					<!--A待跟进-->
					<button class="button-tasks" ng-click="forwardRecive(item)" ng-if="isTodo">接单</button>
				</ion-item>
				<!--<div style="width: 100%;height: 20px; background-color: #E5EEF4"></div>-->
			</ion-item>
		</ion-list>

		<ion-infinite-scroll on-infinite="loadMore()" ng-if="moreDataCanBeLoaded()" distance="10%">
		</ion-infinite-scroll>
	</ion-content>
</ion-view>
